﻿
  CREATE OR REPLACE TRIGGER "EISP"."T_AUTO_TASK_TG" 
  before insert on T_AUTO_TASK
  for each row
begin
  IF :NEW.id is NULL THEN
    SELECT T_AUTO_TASK_SEQ.NEXTVAL INTO :NEW.id FROM dual;
  END IF;
end T_AUTO_TASK_TG;


/
ALTER TRIGGER "EISP"."T_AUTO_TASK_TG" ENABLE;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_BUFFER_LOG_TG" 
  before insert on T_BUFFER_LOG
  for each row
begin
  IF :NEW.id is NULL THEN
    SELECT T_BUFFER_LOG_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
  END IF;
end T_BUFFER_LOG_TG;


/
ALTER TRIGGER "EISP"."T_BUFFER_LOG_TG" ENABLE;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_CALE_TASK_TG" 
  before insert on T_CALC_TASK
  for each row
begin
   SELECT T_CALE_TASK_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_CALE_TASK_TG;


/
ALTER TRIGGER "EISP"."T_CALE_TASK_TG" ENABLE;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_D_ELEC_QUANTITY_TG" 
  before insert on T_D_ELEC_QUANTITY
  for each row
begin
   SELECT T_D_ELEC_QUANTITY_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_D_ELEC_QUANTITY_TG;


/
ALTER TRIGGER "EISP"."T_D_ELEC_QUANTITY_TG" ENABLE;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_D_STAT_INFO_TG" 
  before insert on T_D_STAT_INFO
  for each row
begin
  IF :NEW.id is NULL THEN
    SELECT T_D_STAT_INFO_SEQ.NEXTVAL INTO :NEW.id FROM dual;
  END IF;
end T_D_STAT_INFO_TG;


/
ALTER TRIGGER "EISP"."T_D_STAT_INFO_TG" ENABLE;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_FEP_CONN_STATE_TG" 
  before insert on T_FEP_CONN_STATE
  for each row
begin
   SELECT T_FEP_CONN_STATE_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_FEP_CONN_STATE_TG;


/
ALTER TRIGGER "EISP"."T_FEP_CONN_STATE_TG" ENABLE;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_FREEZE_DATA_TG" 
BEFORE INSERT ON T_FREEZE_DATA
FOR EACH ROW
BEGIN
  SELECT T_FREEZE_DATA_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
END;


/
ALTER TRIGGER "EISP"."T_FREEZE_DATA_TG" ENABLE;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_GENERAL_METER_TG" 
  before insert on t_general_meter
  for each row
begin
   SELECT nvl(max(id),1) + 10000  INTO :NEW.mp_id FROM t_general_meter;
end t_general_meter_tg;

/
ALTER TRIGGER "EISP"."T_GENERAL_METER_TG" ENABLE;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_LINE_LOSE_TG" 
  before insert on T_LINE_LOSS
  for each row
begin
   SELECT T_LINE_LOSE_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_LINE_LOSE_TG;


/
ALTER TRIGGER "EISP"."T_LINE_LOSE_TG" ENABLE;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_LV_FREEZE_D_DATA_TG" 
  before insert on T_LV_FREEZE_D_DATA
  for each row
begin
   SELECT T_LV_FREEZE_D_DATA_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_LV_FREEZE_D_DATA_TG;


/
ALTER TRIGGER "EISP"."T_LV_FREEZE_D_DATA_TG" ENABLE;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_LV_FREEZE_EM_TG" 
  before insert on T_LV_FREEZE_EM
  for each row
begin
   SELECT T_LV_FREEZE_EM_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_LV_FREEZE_EM_TG;


/
ALTER TRIGGER "EISP"."T_LV_FREEZE_EM_TG" ENABLE;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_LV_FREEZE_GEN_EXTREMUM_TG" 
  before insert on T_USER
  for each row
begin
   SELECT T_LV_FREEZE_GEN_EXTREMUM_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_LV_FREEZE_GEN_EXTREMUM_TG;


/
ALTER TRIGGER "EISP"."T_LV_FREEZE_GEN_EXTREMUM_TG" ENABLE;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_LV_FREEZE_GEN_TG" 
  before insert on T_USER
  for each row
begin
   SELECT T_LV_FREEZE_GEN_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_LV_FREEZE_GEN_TG;


/
ALTER TRIGGER "EISP"."T_LV_FREEZE_GEN_TG" ENABLE;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_LV_FREEZE_MY_DATA_TG" 
  before insert on T_LV_FREEZE_MY_DATA
  for each row
begin
   SELECT T_LV_FREEZE_MY_DATA_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_LV_FREEZE_MY_DATA_TG;


/
ALTER TRIGGER "EISP"."T_LV_FREEZE_MY_DATA_TG" ENABLE;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_LV_FREEZE_PLOAD_TG" 
  before insert on T_USER
  for each row
begin
   SELECT T_LV_FREEZE_PLOAD_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_LV_FREEZE_PLOAD_TG;


/
ALTER TRIGGER "EISP"."T_LV_FREEZE_PLOAD_TG" ENABLE;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_MAX_NEED_TG" 
  before insert on T_USER
  for each row
begin
   SELECT T_MAX_NEED_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_MAX_NEED_TG;


/
ALTER TRIGGER "EISP"."T_MAX_NEED_TG" ENABLE;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_MY_ELEC_QUANTITY_TG" 
  before insert on T_MY_ELEC_QUANTITY
  for each row
begin
   SELECT T_MY_ELEC_QUANTITY_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_MY_ELEC_QUANTITY_TG;


/
ALTER TRIGGER "EISP"."T_MY_ELEC_QUANTITY_TG" ENABLE;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_RESIDENT_METER_TG" 
  before insert on T_RESIDENT_METER
  for each row
begin
   SELECT nvl(max(id),1) + 50000000  INTO :NEW.mp_id FROM T_RESIDENT_METER;

end T_RESIDENT_METER_TG;

/
ALTER TRIGGER "EISP"."T_RESIDENT_METER_TG" ENABLE;
 
